import { Injectable } from '@angular/core';
// todo 需要改动
import { BehaviorSubject, Observable } from 'rxjs'

@Injectable()
export class DragDropService {

  constructor() { }

  private _dragData = new BehaviorSubject<DragData>(null);

  setDragData(data:DragData){
    this._dragData.next((data))
  }
  getDragData():Observable<DragData>{
    return this._dragData.asObservable()
  }

  clearDragData(){
    this._dragData.next(null)
  }

}

export interface DragData{
  // 区分哪一拖动的
  tag:string
  // 拖动的数据
  data:any
}
